package com.example.myapplication.xiaochengxu;

import com.example.myapplication.DowdLoadImg2;
import com.example.myapplication.DowdLoadImg4;
import com.example.myapplication.cpdc.BookWordBean;
import com.example.myapplication.shortvideo.utils.GsonUtil;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.List;

/**
 * @author: rongfeng
 * @date: 2021/8/26
 * @description
 */
public class caier {
    public static void main(String[] args) {
        File file = new File("D:\\wrf\\test\\caier.json");
        try {
            String str;
            FileInputStream fileInputStream = new FileInputStream(file);
            InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream);
            BufferedReader bufferedReader = new BufferedReader(inputStreamReader);

            StringBuffer sb = new StringBuffer();
            String text = null;
            while ((text = bufferedReader.readLine()) != null) {
                sb.append(text);
            }
            str = sb.toString();
            Bean bean = GsonUtil.parse(str, Bean.class);
            String json = GsonUtil.toJson(bean);
            System.out.println(json);

        } catch (Exception e) {
            e.printStackTrace();
        }

    }




    static class Bean {
        List<MixedTabs> mixedTabs;
        List<TrackList> trackList;

        static class MixedTabs {
            int id;
            String title;
        }

        static class TrackList {
            int trackId;
            String customTitle;
            int duration;
            int[] tabIds;
        }
    }
}
